<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" template="/layout/normal.xhtml"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:s="http://jboss.com/products/seam/taglib">
	<ui:define name="body">
		<s:validateAll>
	<rich:modalPanel id="panel" width="350" height="100">
		<f:facet name="header">
			<h:panelGroup>
				<h:outputText value="Registar ejemplar"></h:outputText>
			</h:panelGroup>
		</f:facet>
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/images/modal/close.png"
					style="cursor:pointer" id="hidelink" />
				<rich:componentControl for="panel" attachTo="hidelink"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		<h:panelGrid columns="1">
			<h:outputText
				value="Si continua registrará el ejemplar"></h:outputText>
			<br />
		</h:panelGrid>
		<h:panelGrid columns="3">
			<h:outputLink value="#" id="acep">
				<a4j:commandButton value="Aceptar"
					action="#{gestionCanarioCri.guardar}" reRender ="mensaje,principal"
					></a4j:commandButton>
				<rich:componentControl for="panel" attachTo="acep" operation="hide"
					event="onclick" />
			</h:outputLink>
			<rich:spacer style="Width:100px;">
			</rich:spacer>
			<h:outputLink value="#" id="cancel">
				<h:commandButton value="Cancelar"></h:commandButton>
				<rich:componentControl for="panel" attachTo="cancel"
					operation="hide" event="onclick" />
			</h:outputLink>
		</h:panelGrid>
		</rich:modalPanel>
			<h:panelGrid columns="1" id="mensaje">
				<h:messages id="mensajes" />
			</h:panelGrid>

			<h:panelGrid columns="1" styleClass="contenedor_pest">
				<rich:tabPanel id="panelPrincipal">
					<rich:tab label="Gestion Canarios">
						<h:panelGrid id="principal" columns="2" style="width:480px;">
							<h:outputLabel value="Criador" styleClass="th150"></h:outputLabel>
							<h:outputText value="#{gestionCanarioCri.criador.numCriador}"></h:outputText>
							<h:outputLabel value="Nº anilla" styleClass="th150"></h:outputLabel>
							<h:inputText value="#{gestionCanarioCri.pajaro.numAnilla}">
									<a4j:support event="onblur" action="#{gestionCanarioCri.compruebaPajaro()}" reRender="principal,mensaje"/>
							</h:inputText>
							<h:outputLabel value="Tipo" styleClass="th150"></h:outputLabel>
							<h:selectOneMenu value="#{gestionCanarioCri.pajaro.tipo}" styleClass="td400" style ="width:200px">
									<s:selectItems var="tipo" value="#{gestionCanarioCri.listaTipos}"
										label="#{tipo.nombre}" noSelectionLabel=""></s:selectItems>
									<s:convertEntity />
							</h:selectOneMenu>
							<h:outputLabel value="Precio venta" styleClass="th150"></h:outputLabel>
							<h:inputText styleClass="td300" value="#{gestionCanarioCri.pajaro.venta}"
									title="Precio venta" />

							<h:outputLabel value="Vendido" styleClass="th150"></h:outputLabel>
							<h:selectBooleanCheckbox styleClass="td300" style= "margin-left:-142px;" value="#{gestionCanarioCri.pajaro.vendido}"
									title="Vendido" />

							<h:outputLabel value="Observaciones" styleClass="th150"></h:outputLabel>
							<h:inputTextarea styleClass="td300" value="#{gestionCanarioCri.pajaro.observaciones}"
									title="Observaciones" >

							</h:inputTextarea>
						</h:panelGrid>
					</rich:tab>

				</rich:tabPanel>
			</h:panelGrid>
		</s:validateAll>
	</ui:define>
	<ui:define name="botonera">
		<h:panelGrid columns="7" id="botones" styleClass="botones">
			<h:panelGrid columns="1">
				<a4j:commandButton styleClass="boton guardar"
					action="#{gestionCanarioCri.vacio}" value="" id="link1"
					title="Guardar cambios" reRender= "principal, mensaje">
					<rich:componentControl for="panel" attachTo="link1"
										operation="show" event="onclick" />
				</a4j:commandButton>
				<h:outputText value="Guardar" styleClass="boton_texto" />
			</h:panelGrid>
		</h:panelGrid>
	</ui:define>
</ui:composition>

